(function(a,b){
	var _alert = {};

	_alert.success = function(data){//成功
		delOld()
		var data = data || {};
		var ejectbox = document.createElement('div');//创建弹框外层遮罩
		ejectbox.id = "_alert";
		var ejectbox_min = document.createElement('div');
		ejectbox_min.className = 'alert success'
		var iconbox = document.createElement('div');
		iconbox.className = 'icon'
		var titleEl = document.createElement('h1');
		titleEl.innerHTML = data.title || '成功提示'
		var iconbimg = document.createElement('img');
		iconbimg.src = '/static/doclist/icons/success.png'
		iconbox.appendChild(iconbimg);
		iconbox.appendChild(titleEl);
		var msgEl = document.createElement('p');
		msgEl.className = 'msg';
		msgEl.innerHTML = data.msg || '在一个地方就能与朋友们分享您的生活瞬间并聊天!'
		var btnbox = document.createElement('div');
		btnbox.className = 'btnbox';
		var button1 = document.createElement("BUTTON");
		button1.innerHTML = '返回'
		button1.onclick = function(){
			document.getElementById('_alert').className = 'hide';
		}
		btnbox.appendChild(button1);
		ejectbox_min.appendChild(iconbox);
		ejectbox_min.appendChild(msgEl);
		ejectbox_min.appendChild(btnbox);
		ejectbox.appendChild(ejectbox_min);
		ejectbox.onclick = function(){
			// alert(1)
		}
		document.body.appendChild(ejectbox);
	}
	_alert.error = function(data){//失败
		delOld()
		var data = data || {};
		var ejectbox = document.createElement('div');//创建弹框外层遮罩
		ejectbox.id = "_alert";
		var ejectbox_min = document.createElement('div');
		ejectbox_min.className = 'alert error'
		var iconbox = document.createElement('div');
		iconbox.className = 'icon'
		var titleEl = document.createElement('h1');
		titleEl.innerHTML = data.title || '成功提示'
		var iconbimg = document.createElement('img');
		iconbimg.src = '/static/doclist/icons/error.png'
		iconbox.appendChild(iconbimg);
		iconbox.appendChild(titleEl);
		var msgEl = document.createElement('p');
		msgEl.className = 'msg';
		msgEl.innerHTML = data.msg || '在一个地方就能与朋友们分享您的生活瞬间并聊天!'
		var btnbox = document.createElement('div');
		btnbox.className = 'btnbox';
		var button1 = document.createElement("BUTTON");
		button1.innerHTML = '返回'
		button1.onclick = function(){
			document.getElementById('_alert').className = 'hide';
		}
		btnbox.appendChild(button1);
		ejectbox_min.appendChild(iconbox);
		ejectbox_min.appendChild(msgEl);
		ejectbox_min.appendChild(btnbox);
		ejectbox.appendChild(ejectbox_min);
		ejectbox.onclick = function(){
			// alert(1)
		}
		document.body.appendChild(ejectbox);
	}	
	_alert.warning = function(data){//警告
		delOld()
		var data = data || {};
		var ejectbox = document.createElement('div');//创建弹框外层遮罩
		ejectbox.id = "_alert";
		var ejectbox_min = document.createElement('div');
		ejectbox_min.className = 'alert warning'
		var iconbox = document.createElement('div');
		iconbox.className = 'icon'
		var titleEl = document.createElement('h1');
		titleEl.innerHTML = data.title || '成功提示'
		var iconbimg = document.createElement('img');
		iconbimg.src = '/static/doclist/icons/warning.png'
		iconbox.appendChild(iconbimg);
		iconbox.appendChild(titleEl);
		var msgEl = document.createElement('p');
		msgEl.className = 'msg';
		msgEl.innerHTML = data.msg || '在一个地方就能与朋友们分享您的生活瞬间并聊天!'
		var btnbox = document.createElement('div');
		btnbox.className = 'btnbox';
		var button1 = document.createElement("BUTTON");
		button1.innerHTML = '返回'
		button1.onclick = function(){
			document.getElementById('_alert').className = 'hide';
		}
		btnbox.appendChild(button1);
		ejectbox_min.appendChild(iconbox);
		ejectbox_min.appendChild(msgEl);
		ejectbox_min.appendChild(btnbox);
		ejectbox.appendChild(ejectbox_min);
		ejectbox.onclick = function(){
			// alert(1)
		}
		document.body.appendChild(ejectbox);
	}	
	_alert.confirm = function(data,callback){//确认框
		delOld()
		delOld()
		var data = data || {};
		var ejectbox = document.createElement('div');//创建弹框外层遮罩
		ejectbox.id = "_alert";
		var ejectbox_min = document.createElement('div');
		ejectbox_min.className = 'alert confirm'
		var iconbox = document.createElement('div');
		iconbox.className = 'icon'
		var titleEl = document.createElement('h1');
		titleEl.innerHTML = data.title || '成功提示'
		iconbox.appendChild(titleEl);
		var msgEl = document.createElement('p');
		msgEl.className = 'msg';
		msgEl.innerHTML = data.msg || '在一个地方就能与朋友们分享您的生活瞬间并聊天!'
		var btnbox = document.createElement('div');
		btnbox.className = 'btnbox';

		var button1 = document.createElement("BUTTON");
		button1.innerHTML = '确定'
		button1.onclick = function(){
			callback('enter');
			document.getElementById('_alert').className = 'hide';
		}
		btnbox.appendChild(button1);

		var button2 = document.createElement("BUTTON");
		button2.className = "nostyle"
		button2.innerHTML = '返回'
		button1.onclick = function(){
			callback('clear');
			document.getElementById('_alert').className = 'hide';
		}
		btnbox.appendChild(button2);


		ejectbox_min.appendChild(iconbox);
		ejectbox_min.appendChild(msgEl);
		ejectbox_min.appendChild(btnbox);
		ejectbox.appendChild(ejectbox_min);
		ejectbox.onclick = function(){
			// alert(1)
		}
		document.body.appendChild(ejectbox);
	}

	_alert.info = function(msg,delay){//警告
		var ejectbox = document.createElement('div');//创建弹框外层遮罩
		ejectbox.className = "_alert_info";
		ejectbox.innerHTML = msg || '请传入msg参数';
		document.body.appendChild(ejectbox);
		setTimeout(function(){
			a(ejectbox).fadeOut();
		},delay||3000);
	}	




	function delOld(){
		// 删除旧的弹窗元素
		var oldejectbox = document.getElementById('_alert'); 
		if(oldejectbox != null){
			oldejectbox.parentNode.removeChild(oldejectbox)
		}
	}
	b._alert = _alert;
})(jQuery,window)

// document.getElementById("myList").appendChild(newListItem);
// 添加元素
